﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Critex.Helpers;

namespace Critex.ViewModels
{
    public class HtmlAreaViewModel
    {

        public HtmlAreaViewModel()
        {
            
        }

        public HtmlAreaViewModel(Models.HtmlArea htmlArea, int sectionId)
        {
            this.Content = htmlArea.Html;
            this.Title = htmlArea.Title;
            this.Id = htmlArea.Id;
            this.SectionId = sectionId;

            var container = ConnectionHelper.GetContainer();
            var settings = container.Settings.First();

            this.StyleLocation = settings.StyleLocation;
        }

        public int Id { get; set; }

        public string Title { get; set; }

        [UIHint("tinymce_jquery_full"), AllowHtml]
        public string Content { get; set; }

        public object StyleLocation { get; set; }

        public object SectionId { get; set; }
    }
}